From: Adel Gadllah Date: Tue, 7 Jun 2011 21:15:33 +0000 (+0200) Subject: overview: Allow dropping icons on windows X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~8177 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=96dca48b3bb71eb9bd0fc97d7ba8b99f4f727b0c;p=gnome-shell.git overview: Allow dropping icons on windows Currently the user has to find an empty spot in the workspace to be able to launcha new instance of an app using dnd. This is unnecessary hard, so just allow dropping on windows too. https://bugzilla.gnome.org/show_bug.cgi?id=652079 --- diff --git a/js/ui/workspace.js b/js/ui/workspace.js index c734f6f11..f1527f436 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -308,6 +308,21 @@ WindowClone.prototype = { this.emit('drag-begin'); }, + _getWorkspaceActor : function() { + let index = this.metaWindow.get_workspace().index(); + return Main.overview.workspaces.getWorkspaceByIndex(index); + }, + + handleDragOver : function(source, actor, x, y, time) { + let workspace = this._getWorkspaceActor(); + return workspace.handleDragOver(source, actor, x, y, time); + }, + + acceptDrop : function(source, actor, x, y, time) { + let workspace = this._getWorkspaceActor(); + workspace.acceptDrop(source, actor, x, y, time); + }, + _onDragCancelled : function (draggable, time) { this.emit('drag-cancelled'); }, diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index 573a1b894..9c5b59551 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -149,6 +149,10 @@ WorkspacesView.prototype = { return this._workspaces[active]; }, + getWorkspaceByIndex: function(index) { + return this._workspaces[index]; + }, + hide: function() { let activeWorkspaceIndex = global.screen.get_active_workspace_index(); let activeWorkspace = this._workspaces[activeWorkspaceIndex];